VERSION 5.00
Begin VB.Form frmIOR 
   BackColor       =   &H00FFFFFF&
   Caption         =   "Importer of Record"
   ClientHeight    =   4305
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   9975
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   ScaleHeight     =   4305
   ScaleWidth      =   9975
   StartUpPosition =   1  'CenterOwner
   Begin VB.Frame Frame4 
      BackColor       =   &H00FFFFFF&
      Caption         =   " Enter the address of the party responsible for import"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000080FF&
      Height          =   3540
      Left            =   120
      TabIndex        =   14
      Top             =   120
      Width           =   9735
      Begin VB.TextBox Text2 
         Height          =   315
         Left            =   6375
         TabIndex        =   31
         Top             =   2880
         Width           =   3015
      End
      Begin VB.TextBox Text1 
         Height          =   315
         Left            =   6375
         TabIndex        =   29
         Top             =   2520
         Width           =   3015
      End
      Begin VB.TextBox f180 
         Height          =   315
         Left            =   6375
         TabIndex        =   27
         Top             =   2160
         Width           =   3015
      End
      Begin VB.ComboBox f168 
         Height          =   315
         Left            =   1680
         TabIndex        =   0
         Top             =   360
         Width           =   3015
      End
      Begin VB.TextBox f177 
         Height          =   315
         Left            =   6360
         TabIndex        =   11
         Top             =   1800
         Width           =   3015
      End
      Begin VB.TextBox f1343 
         Height          =   315
         Left            =   6360
         TabIndex        =   10
         Top             =   1440
         Width           =   3015
      End
      Begin VB.TextBox f171 
         Height          =   315
         Left            =   1680
         TabIndex        =   3
         Top             =   1440
         Width           =   3015
      End
      Begin VB.TextBox f170 
         Height          =   315
         Left            =   1680
         TabIndex        =   2
         Top             =   1080
         Width           =   3015
      End
      Begin VB.TextBox f174 
         Height          =   315
         Left            =   1680
         TabIndex        =   6
         Top             =   2520
         Width           =   3015
      End
      Begin VB.TextBox f176 
         Height          =   315
         Left            =   6360
         TabIndex        =   8
         Top             =   720
         Width           =   3015
      End
      Begin VB.TextBox f172 
         Height          =   315
         Left            =   1680
         TabIndex        =   4
         Top             =   1800
         Width           =   3015
      End
      Begin VB.TextBox f173 
         Height          =   315
         Left            =   1680
         TabIndex        =   5
         Top             =   2160
         Width           =   3015
      End
      Begin VB.TextBox f178 
         Height          =   315
         Left            =   6360
         TabIndex        =   9
         Top             =   1080
         Width           =   3015
      End
      Begin VB.ComboBox f175 
         Height          =   315
         Left            =   6360
         TabIndex        =   7
         Top             =   360
         Width           =   3015
      End
      Begin VB.ComboBox f169 
         Height          =   315
         Left            =   1680
         TabIndex        =   1
         Top             =   720
         Width           =   3015
      End
      Begin VB.Label Label14 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "Broker Telephone:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4815
         TabIndex        =   32
         Top             =   2940
         Width           =   1455
      End
      Begin VB.Label Label13 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "Broker Name:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4815
         TabIndex        =   30
         Top             =   2580
         Width           =   1455
      End
      Begin VB.Label Label11 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "Tax ID:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4815
         TabIndex        =   28
         Top             =   2220
         Width           =   1455
      End
      Begin VB.Label Label15 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "Account Number:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4800
         TabIndex        =   26
         Top             =   1860
         Width           =   1455
      End
      Begin VB.Label Label12 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "Email Address:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4800
         TabIndex        =   25
         Top             =   1500
         Width           =   1455
      End
      Begin VB.Label Label3 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "IOR Company:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   24
         Top             =   1500
         Width           =   1455
      End
      Begin VB.Label Label1 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "IOR Name:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   22
         Top             =   1140
         Width           =   1455
      End
      Begin VB.Label Label7 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "Address 1:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   21
         Top             =   1860
         Width           =   1455
      End
      Begin VB.Label Label6 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "Country:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   20
         Top             =   780
         Width           =   1455
      End
      Begin VB.Label Label5 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "Zip:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4800
         TabIndex        =   19
         Top             =   780
         Width           =   1455
      End
      Begin VB.Label Label4 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "State:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4800
         TabIndex        =   18
         Top             =   420
         Width           =   1455
      End
      Begin VB.Label Label10 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "Address 2:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   17
         Top             =   2220
         Width           =   1455
      End
      Begin VB.Label Label8 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "City:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   16
         Top             =   2580
         Width           =   1455
      End
      Begin VB.Label Label9 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "Telephone:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4800
         TabIndex        =   15
         Top             =   1140
         Width           =   1455
      End
      Begin VB.Label Label2 
         Alignment       =   1  'Right Justify
         BackColor       =   &H00FFFFFF&
         Caption         =   "IOR ID:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   23
         Top             =   420
         Width           =   1455
      End
   End
   Begin VB.CommandButton cmdSave 
      Appearance      =   0  'Flat
      BackColor       =   &H00E0E0E0&
      Caption         =   "Save/Exit"
      Height          =   315
      Left            =   3480
      MaskColor       =   &H0080C0FF&
      Style           =   1  'Graphical
      TabIndex        =   12
      Top             =   3840
      UseMaskColor    =   -1  'True
      Width           =   1215
   End
   Begin VB.CommandButton cmdCancel 
      Appearance      =   0  'Flat
      BackColor       =   &H00E0E0E0&
      Caption         =   "Cancel"
      Height          =   315
      Left            =   5280
      MaskColor       =   &H0080C0FF&
      Style           =   1  'Graphical
      TabIndex        =   13
      Top             =   3840
      UseMaskColor    =   -1  'True
      Width           =   1215
   End
End
Attribute VB_Name = "frmIOR"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False


'---------------------------------------------------------------------------------------
' Procedure : LoadAddrFields()
' DateTime  : 8/31/2004
' Purpose   : Loads recipient info onto Ship form
' Call from :
'---------------------------------------------------------------------------------------
'
Private Sub LoadAddrFields(ByVal strLookupFld As String, ByVal strValue As String)
    On Error GoTo EH
    g_strErrorLocation = Me.name & ":LoadAddrFields"
    
    Dim strQuery As String
    Dim rsCustomer As New ADODB.Recordset
    
    strQuery = "SELECT * FROM AddressBook WHERE " & strLookupFld & " = " & SingleQuotes(strValue)
    rsCustomer.Open strQuery, g_connFSMSClient, adOpenKeyset, adLockOptimistic
    If Not rsCustomer.EOF Then
        f168 = rsCustomer!CustID
        f169 = rsCustomer!f50
        f170 = rsCustomer!f11
        f171 = rsCustomer!f12
        f172 = rsCustomer!f13
        f173 = rsCustomer!f14
        f174 = rsCustomer!f15
        f175 = rsCustomer!f16
        f176 = rsCustomer!f17
        f178 = rsCustomer!f18
        f177 = rsCustomer!f20
        f180 = rsCustomer!f118
    End If
    
Release:
    If rsCustomer.State = adStateOpen Then rsCustomer.Close
    Set rsCustomer = Nothing
    Exit Sub

EH:
    MsgBox Err.Description, vbCritical, g_strErrorLocation
    Resume Release

End Sub



'---------------------------------------------------------------------------------------
' Procedure : cmdCancel_Click()
' DateTime  : 2/18/2004
' Purpose   : Cancel button hides form
'---------------------------------------------------------------------------------------
'
Private Sub cmdCancel_Click()
    Me.Hide
    frmShip.SetFocus
End Sub
'---------------------------------------------------------------------------------------
' Procedure : cmdSave_Click()
' DateTime  : 2/18/2004
' Purpose   : Save button assigns BSO fields to global vars
'---------------------------------------------------------------------------------------
'
Private Sub cmdSave_Click()
    
    g_str168 = f168
    g_str169 = Left(f169, 2)
    g_str170 = f170
    g_str171 = f171
    g_str172 = f172
    g_str173 = f173
    g_str174 = f174
    g_str175 = f175
    g_str176 = f176
    g_str177 = f177
    g_str178 = f178
    g_str180 = f180
    g_str181 = f181
    g_str182 = f182
    
    Me.Hide
    frmShip.SetFocus
End Sub
'---------------------------------------------------------------------------------------
' Procedure : f177_Change()
' DateTime  : 2/18/2004
' Purpose   : Broker Acct# is numeric with a max length of 9
'---------------------------------------------------------------------------------------
'
Private Sub f177_Change()
    Call NumericOnly(f177, False)
    Call CheckLength(f177, 9)
End Sub
'---------------------------------------------------------------------------------------
' Procedure : f175_Change()
' DateTime  : 8/9/2004
' Purpose   : Calls a routine to populate the entire text of selected state.
'---------------------------------------------------------------------------------------
'
Private Sub f175_Change()
    If Len(f175) >= 2 Then
        Call SetComboSelection(f175, f175)
    End If
End Sub
'---------------------------------------------------------------------------------------
' Procedure : f169_Change()
' DateTime  : 2/18/2004
' Modified  : 11/10/2004 fixed Country code being cleared.
' Purpose   : If Broker Country is US load State combo.
'---------------------------------------------------------------------------------------
'
Private Sub f169_Change()
    
    If Len(f169) >= 2 Then
        Call SetComboSelection(f169, f169)
    End If
    
End Sub
'---------------------------------------------------------------------------------------
' Procedure : f169_Click()
' DateTime  : 2/18/2004
' Purpose   : If US load states, if CA load provinces, else clear state combo
'---------------------------------------------------------------------------------------
'
Private Sub f169_Click()
    
    If Left(f169, 2) = "US" Then
        Call LoadStates(f175)
    ElseIf Left(f169, 2) = "CA" Then
        Call LoadProvinces(f175)
    Else
        f175.Clear
    End If

End Sub

Private Sub f169_KeyPress(KeyAscii As Integer)

    Call SearchCombo(f169, KeyAscii)

End Sub

Private Sub f169_LostFocus()

    Dim strQuery As String
    Dim rsQuery As ADODB.Recordset
    
    If f169 <> "" Then
        Call LoadAddrFields("CustID", f169)
    End If

End Sub


'---------------------------------------------------------------------------------------
' Procedure : f178_Change()
' DateTime  : 2/18/2004
' Purpose   : Broker phone is numeric only
'---------------------------------------------------------------------------------------
'
Private Sub f178_Change()
    Call NumericOnly(f178, False)
End Sub
'---------------------------------------------------------------------------------------
' Procedure : Form_Activate()
' DateTime  : 11/11/2004
' Purpose   : Set Country Code to Recipient Country Code
'---------------------------------------------------------------------------------------
'
Private Sub Form_Activate()
    If f169 = "" Then
        f168 = frmShip.cboCustID
        f169 = frmShip.f50
        f170 = frmShip.f11
        f171 = frmShip.f12
        f172 = frmShip.f13
        f173 = frmShip.f14
        f174 = frmShip.f15
        f175 = frmShip.f16
        f176 = frmShip.f17
        f178 = frmShip.f18
        f180 = frmShip.f1358
    End If
End Sub
'---------------------------------------------------------------------------------------
' Procedure : Form_KeyDown()
' DateTime  : 2/17/2005
' Purpose   : Enter key pressed sends a TAB to move to next field
'---------------------------------------------------------------------------------------
'
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    If Not TypeOf Me.ActiveControl Is CommandButton Then
        If Shift = 0 And KeyCode = 13 Then
            SendKeys "{TAB}"
        End If
    End If
End Sub
'---------------------------------------------------------------------------------------
' Procedure : Form_Load()
' DateTime  : 2/18/2004
' Purpose   : Form Load, load State and Country combos, set Country to US.
'---------------------------------------------------------------------------------------
'
Private Sub Form_Load()
    'Initialize State combo
    Call LoadStates(f175)
    
    'Initialize Countries combo
    Call LoadCountries(f169)
    
    Call frmShip.LoadAddrLookupCombos(f169, f169, "CustID")

End Sub

